﻿<Controls:SinacorWindow x:Class="Sinacor.UI.Design.Tester.View.SmartClient.ExemploExplorer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SinacorExplorer"  
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
    xmlns:DataGrid="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient.DataGrid;assembly=Sinacor.Infra.UI.Controls"
    ModuleId="OMF"
    ModulePlus="True" 
    WindowState="Normal"
    Width="800" Height="600">

    <Controls:SinacorDragDrop x:Name="dragDrop">

        <Controls:SinacorExplorer x:Name="explorer" IsItemDetailsVisible="True">
            
            <!-- TreeView -->
            <Controls:SinacorExplorer.Groups>
                <Controls:SinacorTreeView x:Name="treeView" 
                                          Controls:SinacorDragDrop.IsDragSource="True"
                                          Controls:SinacorDragDrop.IsDropTarget="True">
                    <Controls:SinacorTreeViewItem Header="Item 1">
                        <Controls:SinacorTreeViewItem Header="SubItem 1" />
                        <Controls:SinacorTreeViewItem Header="SubItem 2" />
                        <Controls:SinacorTreeViewItem Header="SubItem 3" />
                    </Controls:SinacorTreeViewItem>
                    <Controls:SinacorTreeViewItem Header="Item 2" IsExpanded="True">
                        <Controls:SinacorTreeViewItem Header="SubItem 1" />
                        <Controls:SinacorTreeViewItem Header="SubItem 2" />
                        <Controls:SinacorTreeViewItem Header="SubItem 3" />
                    </Controls:SinacorTreeViewItem>
                    <Controls:SinacorTreeViewItem Header="Item 3">
                        <Controls:SinacorTreeViewItem Header="SubItem 1" />
                        <Controls:SinacorTreeViewItem Header="SubItem 2" />
                        <Controls:SinacorTreeViewItem Header="SubItem 3" />
                    </Controls:SinacorTreeViewItem>
                </Controls:SinacorTreeView>
            </Controls:SinacorExplorer.Groups>

            <!-- Items selecionados do TreeView -->
            <Controls:SinacorExplorer.NavigationPath>
                <Controls:SinacorNavigationPath x:Name="navigationPath" DisplayMemberPath="Descricao" ItemsSource="{Binding Groups.SelectedPath, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:SinacorExplorer}}}" />
            </Controls:SinacorExplorer.NavigationPath>

            <!-- Visualizações -->
            <Controls:SinacorExplorer.Views>

                <!-- Visualização por lista -->
                <Controls:ExplorerListView>
                    <Controls:SinacorListView x:Name="listView" 
                                              Controls:SinacorDragDrop.IsDragSource="True"
                                              Controls:SinacorDragDrop.IsDropTarget="True">
                        <Controls:SinacorListViewItem Content="SubItem 1" />
                        <Controls:SinacorListViewItem Content="SubItem 2" />
                        <Controls:SinacorListViewItem Content="SubItem 3" />
                        <Controls:SinacorListViewItem Content="SubItem 4" IsSelected="True" />
                        <Controls:SinacorListViewItem Content="SubItem 5" />
                        <Controls:SinacorListViewItem Content="SubItem 6" />
                        <Controls:SinacorListViewItem Content="SubItem 7" />
                        <Controls:SinacorListViewItem Content="SubItem 8" />
                        <Controls:SinacorListViewItem Content="SubItem 9" />
                        <Controls:SinacorListViewItem Content="SubItem 10" />
                        <Controls:SinacorListViewItem Content="SubItem 11" />
                        <Controls:SinacorListViewItem Content="SubItem 12" />
                        <Controls:SinacorListViewItem Content="SubItem 13" />
                        <Controls:SinacorListViewItem Content="SubItem 14" />
                        <Controls:SinacorListViewItem Content="SubItem 15" />
                    </Controls:SinacorListView>
                </Controls:ExplorerListView>

                <!-- Visualização por detalhes -->
                <Controls:ExplorerDetailsView>
                    <DataGrid:SinacorDataGrid x:Name="detailsView" 
                                              Controls:SinacorDragDrop.IsDragSource="True"
                                              Controls:SinacorDragDrop.IsDropTarget="True">
                        <DataGrid:SinacorDataGrid.Columns>
                            <DataGrid:DataGridTextColumn Name="Codigo" Header="Código" Binding="{Binding Codigo}" />
                            <DataGrid:DataGridTextColumn Name="Descricao" Header="Descrição" Binding="{Binding Descricao}"  />
                        </DataGrid:SinacorDataGrid.Columns>
                    </DataGrid:SinacorDataGrid>
                </Controls:ExplorerDetailsView>

            </Controls:SinacorExplorer.Views>

            <!-- Detalhes -->
            <Controls:SinacorExplorer.ItemDetails>
                <DataGrid:SinacorDataGrid x:Name="itemDetails">
                    <DataGrid:SinacorDataGrid.Columns>
                        <DataGrid:DataGridTextColumn Name="Codigo" Header="Código" Binding="{Binding Codigo}" />
                        <DataGrid:DataGridTextColumn Name="Descricao" Header="Descrição" Binding="{Binding Descricao}"  />
                    </DataGrid:SinacorDataGrid.Columns>
                </DataGrid:SinacorDataGrid>
            </Controls:SinacorExplorer.ItemDetails>

        </Controls:SinacorExplorer>
    </Controls:SinacorDragDrop>

</Controls:SinacorWindow>